Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add redux to dashboard state management #14103

Conversation

stacey-gammon
Copy link
Contributor

@stacey-gammon stacey-gammon commented Sep 21, 2017

This is built off the gridster -> react-grid-layout PR.

This is a work in progress, but here is a diagram of how the new redux/angular state management interacts. This is subject to change.

screen shot 2017-09-21 at 4 53 39 pm

Angular UI is comprised of:

  • time picker
  • top nav bar
  • filter bar
  • query bar
  • chrome

React UI is comprised of:

  • dashboard "viewport".

The redux store is created at the root of the Kibana app (src/core_plugins/kibana/public/store.js). Since we only want a single source of truth per app, and the core kibana app is made up of many sub apps (discover, visualize, dashboard, etc), these sub apps can use the store when they are ready to switch over.

# This is the 1st commit message:
Add margin of error to test determining panel widths

# This is the commit message #2:

use real kibana version when creating panel data. Will make future conversions easier.

# This is the commit message #3:

Fix lint errors
use real kibana version when creating panel data. Will make future conversions easier.

Move default height and width to dashboard_constants so those that need it don't end up including extra stuff like ui/chrome
…, and handle case where destroyEmbeddable is not defined.
Had to implement this via code
Am not aware of a better way to handle this, aside from switching to
redux, since it’s recommended not to put async calls in
componentWillMount.  Since I plan to investigate redux next, disabling
for now. Open to other’s opinions on the matter.
@alexfrancoeur
Copy link

@stacey-gammon First quick pass with the new react grid and it looks great!! A few questions, comments and potential bugs below.

This seems to be specific to input controls but I can resize the panel and the visualization does not seem to adhere to the new dimensions.

screen shot 2017-09-22 at 10 51 53 am

I recall you mentioning that the grid would be responsive so I checked it out with iPhone dimensions. I would have expected the panels to be force into one column rather than squishing two together at a certain point. Is this an expectation for the PR or out of scope?

screen shot 2017-09-22 at 10 53 08 am

There seems to be an issue with region maps where sometimes the drop down appears when clicked and other times it did not

screen shot 2017-09-22 at 10 53 30 am

Currently, the drop down can only be seen on edit mode. Most of the components here are specific to editing and deleting panels but are there any in which we'd need to surface this in view mode?

screen shot 2017-09-22 at 11 16 05 am

Should we provide some default restrictions as far as size goes? Or do we just give users free range and allow them to make their own mistakes? I imagine small panels will be especially useful for metrics, etc.

screen shot 2017-09-22 at 11 18 10 am

That's my first pass, hope this helps

@stacey-gammon
Copy link
Contributor Author

stacey-gammon commented Sep 22, 2017

@alexfrancoeur -The PR you want is #13853, but your comments are relevant to that one as well, so I'll answer:

This seems to be specific to input controls but I can resize the panel and the visualization does not seem to adhere to the new dimensions.

Known issue with input controls, this should be the case on master as well. #13982

I recall you mentioning that the grid would be responsive so I checked it out with iPhone dimensions. I would have expected the panels to be force into one column rather than squishing two together at a certain point. Is this an expectation for the PR or out of scope?

I did not make it responsive intentionally. For the first switch over I wanted to get it to match the previous implementation as close as possible. Then we can focus on how the responsiveness should work in a separate PR. It is possible though.

There seems to be an issue with region maps where sometimes the drop down appears when clicked and other times it did not

Check out the PR above and let me know if it's still an issue. There was a problem with the drag event taking over the click event for the pop up which would annoying cause it to not pop up all the time. If it's still an issue I'll look into it.

Currently, the drop down can only be seen on edit mode. Most of the components here are specific to editing and deleting panels but are there any in which we'd need to surface this in view mode?

Not yet, according to the design mocks:
screen shot 2017-09-22 at 12 47 28 pm
screen shot 2017-09-22 at 12 48 44 pm
But we can easily put the menu option in view mode later if we add some later.

Should we provide some default restrictions as far as size goes? Or do we just give users free range and allow them to make their own mistakes? I imagine small panels will be especially useful for metrics, etc.

Yea, I think we should let them make their own mistakes. Otherwise we are making assumptions on what is inside the panel.

@stacey-gammon
Copy link
Contributor Author

Closed in favor of #14199

@stacey-gammon stacey-gammon deleted the react/replace-dashboard-grid-redux branch October 24, 2017 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants